from rest_framework import serializers
from resume import models


class ResumeSerializer(serializers.ModelSerializer):
    u = serializers.SerializerMethodField()
    def get_u(self,obj):
        return obj.user.username
    class Meta:
        model = models.Resume
        fields = '__all__'
class EducatedSerializer(serializers.ModelSerializer):
    r = serializers.SerializerMethodField()
    def get_r(self,obj):
        return obj.resume.name
    class Meta:
        model = models.Educated
        fields = '__all__'